package gui;

import javax.swing.JPanel;
import java.awt.GridBagLayout;
import javax.swing.JTextField;
import java.awt.GridBagConstraints;
import java.awt.Insets;

import javax.swing.JButton;

/**
 * Provides a textarea GUI to write messages
 *
 * @author Dominik Korittki
 * @author Steffen Grushka
 * @version 0.1
 */
public class WritePanel extends JPanel {
	
	private static final long serialVersionUID = 1L;
	private JTextField textField;
	private JButton btnSenden;

	/**
	 * Create the panel.
	 */
	public WritePanel() {
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{365, 0, 0};
		gridBagLayout.rowHeights = new int[]{0, 0};
		gridBagLayout.columnWeights = new double[]{1.0, 0.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, Double.MIN_VALUE};
		setLayout(gridBagLayout);
		
		textField = new JTextField();
		GridBagConstraints gbc_textField = new GridBagConstraints();
		gbc_textField.insets = new Insets(0, 0, 0, 5);
		gbc_textField.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField.gridx = 0;
		gbc_textField.gridy = 0;
		add(textField, gbc_textField);
		textField.setColumns(10);
		
		btnSenden = new JButton("Senden");
		GridBagConstraints gbc_btnSenden = new GridBagConstraints();
		gbc_btnSenden.gridx = 1;
		gbc_btnSenden.gridy = 0;
		add(btnSenden, gbc_btnSenden);
	}

	public JButton getBtnSenden() {
		return btnSenden;
	}

	public JTextField getTextField() {
		return textField;
	}

}
